//
//  AboutViewController.m
//  FruitHelper
//
//  Created by 赵隆杰 on 2021/12/11.
//

#import "AboutViewController.h"

@interface AboutViewController ()

@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) UILabel *titleLabel;

@end

@implementation AboutViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.title = @"关于";
    
    UIImageView *imageView = [[UIImageView alloc] init];
    imageView.image = [UIImage imageNamed:@"appicon"];
    imageView.contentMode = UIViewContentModeScaleAspectFill;
    imageView.layer.cornerRadius = 5;
    imageView.layer.masksToBounds = YES;
    [self.view addSubview:imageView];
    self.imageView = imageView;
    [_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.width.height.equalTo(@100);
        make.top.equalTo(self.view).offset(150);
    }];

    UILabel *titleLabel = [[UILabel alloc] init];
    titleLabel.font = [UIFont systemFontOfSize:14];
    [self.view addSubview:titleLabel];
    self.titleLabel = titleLabel;
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.equalTo(_imageView.mas_bottom).offset(10);
        make.height.equalTo(@40);
    }];
    
    //系统直接读取的版本号
    NSString *versionValueStringForSystemNow = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
    self.titleLabel.text = [NSString stringWithFormat:@"当前版本：V%@", versionValueStringForSystemNow];

    UILabel *bottomLabel = [[UILabel alloc] init];
    bottomLabel.font = [UIFont systemFontOfSize:14];
    bottomLabel.text = [NSString stringWithFormat:@"联系我们：695961112@qq.com"];
    [self.view addSubview:bottomLabel];
    self.titleLabel = titleLabel;
    [bottomLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.bottom.equalTo(self.view).offset(-100);
        make.height.equalTo(@40);
    }];
}


@end
